/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.bytedance.scenedemo.animatiom.sipnner;

import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.agp.render.render3d.math.Quaternion;

/**
 * PopupInfo.
 *
 * @since 2021-06-17
 */
public class PopupInfo {
    /**
     * 圆角
     */
    private static final float BORDER_RADIUS = 15;
    /**
     * 窗体的类型
     */
    private PopupType popupType = null;
    /**
     * 点击外部消失
     */
    private Boolean isDismissOnTouchOutside = true;
    /**
     * 操作完毕后是否自动关闭
     */
    private Boolean autoDismiss = true;
    /**
     * 是否有半透明的背景
     */
    private Boolean hasShadowBg = true;
    /**
     * 是否有高斯模糊背景
     */
    private Boolean hasBlurBg = false;
    /**
     * 依附于那个View显示
     */
    private Component atView = null;
    /**
     * 依附于那个View显示
     */
    private Component watchView = null;
    /**
     * 动画执行器，如果不指定，则会根据窗体类型popupType字段生成默认合适的动画执行器
     */
    private PopupAnimation popupAnimation = null;
    /**
     * 动画执行器，如果不指定，则会根据窗体类型popupType字段生成默认合适的动画执行器
     */
    private PopupAnimator customAnimator = null;
    /**
     * 触摸的点
     */
    private Quaternion touchPoint = null;
    /**
     * 最大宽度
     */
    private int maxWidth;
    /**
     * 最大高度
     */
    private int maxHeight;
    /**
     * 指定弹窗的宽，受max的宽高限制
     */
    private int popupWidth;
    /**
     * 指定弹窗的高，受max的宽高限制
     */
    private int popupHeight;

    /**
     * 每个弹窗所属的DecorView
     */
    private ComponentContainer decorView;
    /**
     * 弹窗出现在目标的什么位置
     */
    private PopupPosition popupPosition = null;
    /**
     * 是否显示状态栏
     */
    private Boolean hasStatusBar = true;
    /**
     * x方向的偏移量
     */
    private int offsetX;
    /**
     * y方向的偏移量
     */
    private int offsetY;
    /**
     * 是否水平居中
     */
    private boolean isCenterHorizontal = false;
    /**
     * 弹窗是否强制抢占焦点
     */
    private boolean isRequestFocus = true;
    /**
     * 是否点击透传，默认弹背景点击是拦截的
     */
    private boolean isClickThrough = false;
    /**
     * 是否允许应用在后台的时候也能弹出弹窗
     */
    private boolean enableShowWhenAppBackground = false;
    /**
     * 是否关闭后进行资源释放
     */
    private boolean isDestroyOnDismiss = false;
    /**
     * 是否已屏幕中心进行定位，默认根据Material范式进行定位
     */
    private boolean positionByWindowCenter = false;

    public PopupType getPopupType() {
        return popupType;
    }

    public void setPopupType(PopupType popupType) {
        this.popupType = popupType;
    }

    public Boolean getDismissOnTouchOutside() {
        return isDismissOnTouchOutside;
    }

    public void setDismissOnTouchOutside(Boolean dismissOnTouchOutside) {
        isDismissOnTouchOutside = dismissOnTouchOutside;
    }

    public Boolean getAutoDismiss() {
        return autoDismiss;
    }

    public void setAutoDismiss(Boolean autoDismiss) {
        this.autoDismiss = autoDismiss;
    }

    public Boolean getHasShadowBg() {
        return hasShadowBg;
    }

    public void setHasShadowBg(Boolean hasShadowBg) {
        this.hasShadowBg = hasShadowBg;
    }

    public Boolean getHasBlurBg() {
        return hasBlurBg;
    }

    public void setHasBlurBg(Boolean hasBlurBg) {
        this.hasBlurBg = hasBlurBg;
    }

    public void setAtView(Component atView) {
        this.atView = atView;
    }

    public Component getWatchView() {
        return watchView;
    }

    public void setWatchView(Component watchView) {
        this.watchView = watchView;
    }

    public PopupAnimation getPopupAnimation() {
        return popupAnimation;
    }

    public void setPopupAnimation(PopupAnimation popupAnimation) {
        this.popupAnimation = popupAnimation;
    }

    public PopupAnimator getCustomAnimator() {
        return customAnimator;
    }

    public void setCustomAnimator(PopupAnimator customAnimator) {
        this.customAnimator = customAnimator;
    }

    public Quaternion getTouchPoint() {
        return touchPoint;
    }

    public void setTouchPoint(Quaternion touchPoint) {
        this.touchPoint = touchPoint;
    }

    public int getMaxWidth() {
        return maxWidth;
    }

    public void setMaxWidth(int maxWidth) {
        this.maxWidth = maxWidth;
    }

    public int getMaxHeight() {
        return maxHeight;
    }

    public void setMaxHeight(int maxHeight) {
        this.maxHeight = maxHeight;
    }

    public int getPopupWidth() {
        return popupWidth;
    }

    public void setPopupWidth(int popupWidth) {
        this.popupWidth = popupWidth;
    }

    public int getPopupHeight() {
        return popupHeight;
    }

    public void setPopupHeight(int popupHeight) {
        this.popupHeight = popupHeight;
    }

    public float getBorderRadius() {
        return BORDER_RADIUS;
    }

    public ComponentContainer getDecorView() {
        return decorView;
    }

    public void setDecorView(ComponentContainer decorView) {
        this.decorView = decorView;
    }

    public PopupPosition getPopupPosition() {
        return popupPosition;
    }

    public void setPopupPosition(PopupPosition popupPosition) {
        this.popupPosition = popupPosition;
    }

    public Boolean getHasStatusBar() {
        return hasStatusBar;
    }

    public void setHasStatusBar(Boolean hasStatusBar) {
        this.hasStatusBar = hasStatusBar;
    }

    public int getOffsetX() {
        return offsetX;
    }

    public void setOffsetX(int offsetX) {
        this.offsetX = offsetX;
    }

    public int getOffsetY() {
        return offsetY;
    }

    public void setOffsetY(int offsetY) {
        this.offsetY = offsetY;
    }

    public boolean isCenterHorizontal() {
        return isCenterHorizontal;
    }

    public void setCenterHorizontal(boolean centerHorizontal) {
        isCenterHorizontal = centerHorizontal;
    }

    public boolean isRequestFocus() {
        return isRequestFocus;
    }

    public void setRequestFocus(boolean requestFocus) {
        isRequestFocus = requestFocus;
    }

    public boolean isClickThrough() {
        return isClickThrough;
    }

    public void setClickThrough(boolean clickThrough) {
        isClickThrough = clickThrough;
    }

    public boolean isEnableShowWhenAppBackground() {
        return enableShowWhenAppBackground;
    }

    public void setEnableShowWhenAppBackground(boolean enableShowWhenAppBackground) {
        this.enableShowWhenAppBackground = enableShowWhenAppBackground;
    }

    public boolean isDestroyOnDismiss() {
        return isDestroyOnDismiss;
    }

    public void setDestroyOnDismiss(boolean destroyOnDismiss) {
        isDestroyOnDismiss = destroyOnDismiss;
    }

    public boolean isPositionByWindowCenter() {
        return positionByWindowCenter;
    }

    public void setPositionByWindowCenter(boolean positionByWindowCenter) {
        this.positionByWindowCenter = positionByWindowCenter;
    }

    public Component getAtView() {
        return atView;
    }

}
